package org.springside.examples.miniweb.service.dictionary;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import org.springside.examples.miniweb.entity.dictionary.DictionaryClass;
import org.springside.examples.miniweb.dao.dictionary.DictionaryClassDao;
import org.springside.modules.orm.Page;
import org.springside.modules.orm.PropertyFilter;

@Service
@Transactional
public class DictionaryClassManager {
	@Autowired
	private DictionaryClassDao dictionaryClassDao;

	// DictionaryClass Manager //
	@Transactional(readOnly = true)
	public DictionaryClass getDictionaryClass(Long id) {
		return dictionaryClassDao.get(id);
	}

	@Transactional(readOnly = true)
	public List<DictionaryClass> getAllDictionaryClass() {
		return dictionaryClassDao.getAll();
	}
	
	@Transactional(readOnly = true)
	public Page<DictionaryClass> searchDictionaryClass(final Page<DictionaryClass> page, final List<PropertyFilter> filters) {
		return dictionaryClassDao.findPage(page, filters);
	}	
	
	public void saveDictionaryClass(DictionaryClass dictionaryClass) {
		dictionaryClassDao.save(dictionaryClass);
	}

	public void deleteDictionaryClass(Long id) {
		dictionaryClassDao.delete(id);
	}
}

